<include file="Public/header" />
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>邀请码管理</h3>
      <ul class="tab-base">
         <li><a href="{:U('InviteManage/index')}"><span>管理</span></a></li>
        <li><a href="JavaScript:void(0);" class="current"><span>添加</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form id="add_form" method="post" action="{:U('InviteManage/add',array('op'=>'add'))}">
    <table class="table tb-type2 nobdb">
      <tbody>
        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="count">生成邀请码数量:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" id="count" name="count" value="" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>
      </tbody>
      <tfoot>
        <tr class="tfoot">
          <td colspan="2"><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span>保存</span></a></td>
        </tr>
      </tfoot>
    </table>
  </form>
</div>
<script>
//按钮先执行验证再提交表
$(function(){$("#submitBtn").click(function(){
    if($("#add_form").valid()){
     $("#add_form").submit();
	}
	});
});
$(document).ready(function(){
	$("#add_form").validate({
		errorPlacement: function(error, element){
			error.appendTo(element.parent().parent().prev().find('td:first'));
        },
        success: function(label){
            label.addClass('valid');
        },
        rules : {
            count : {
			 	required : true,	
			}
        },
        messages : {
            count : {
			 	required : '请输入数量',
			}
        }
	});
});
</script> 
<include file="Public/footer" />